from django.db import models
from django.contrib.auth.models import AbstractUser


# Create your models here.


class User(AbstractUser):
    signature = models.CharField(max_length=200, verbose_name='签名', null=True)
    name = models.CharField(max_length=20, verbose_name='昵称')
    privacy = models.BooleanField(default=True, verbose_name='隐私，默认可被所有人看')
    head_path = models.CharField(max_length=100, verbose_name='头像照片路径', null=True)
    email = models.EmailField(verbose_name='邮箱', unique=True)
    create_time = models.DateField(verbose_name='创建时间', auto_now_add=True)
    username = None
    USERNAME_FIELD = 'email'
    REQUIRED_FIELDS = []

    class Meta:
        db_table = 'tb_user'
        verbose_name = '用户表'
        verbose_name_plural = verbose_name
